<template>
  <div class="my-wrap">
    <div class="hd-status-user" @click="linkTo({ name: 'HomePerson' })">
      <div class="hd-user-face">
        <img
          src="https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eoAzicgLz7U4ZVA6iahx7wqUoI6Z6WSPh1Z7D9V8GDGLUGiaQjJXMxQIccSne9ibDXhK8YhU2PPAOicdAA/132"
          alt=""
        />
      </div>
      <div class="hd-user-info">
        <div class="user-name">恩格拉</div>
        <div class="user-desc">他太懒了，还没留下签名</div>
      </div>
    </div>
       <scroll-swiper
        class="g-flex-box my-warp"
        v-model="currentIndex"
        :navs="tabs"
      >
        <template v-for="(item, index) in tabs" :key="index" v-slot:[index]>
          <component
            :is="item.is"
            :actived="currentIndex == index"
            :type="item.type"
          />
        </template>
      </scroll-swiper>
    <BottomMenu></BottomMenu>
  </div>
</template>

<script>
import BottomMenu from 'lottery/components/BottomMenu/BottomMenu';
import ScrollSwiper from 'lottery/components/ScrollSwiper/ScrollSwiper';
import { shallowRef } from 'vue';
import dynamic from './tabs/dynamic/dynamic.vue';
import mumberSelection from './tabs/mumber-selection/mumber-selection.vue';

export default {
  name: 'VueJiangduoduoComMy',
  components: {
    BottomMenu,
    ScrollSwiper,
    dynamic,
    mumberSelection,
  },
  data() {
    return {
      currentIndex: 0,
      tabs: [
        {
          title: '动态',
          is: shallowRef(dynamic),
          type: 0,
        },
        {
          title: '选号',
          is: shallowRef(mumberSelection),
          type: 1,
        },
      ],
    };
  },

  mounted() {},

  methods: {
    /**
     * @desc 路由跳转
     * @param {String} location des
     */
    linkTo(location) {
      this.$router.push(location);
    },
  },
};
</script>

<style lang="scss" scoped>
.my-wrap {
  width: 100%;
  height: 100%;
  .hd-status-user {
    background: white;
    padding: 30px 24px 20px;
    display: flex;
    align-items: center;
    .hd-user-face {
      flex-shrink: 0;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      margin-right: 20px;
      overflow: hidden;
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    .hd-user-info {
      text-align: left;
      flex: 1;
      .user-name {
        max-width: 200px;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 20px;
        color: #333333;
      }
      .user-desc {
        color: #666666;
        font-size: 13px;
        margin-top: 5px;
        line-height: 1.5;
        word-break: break-all;
        word-wrap: break-word;
      }
    }
  }
 ::v-deep .swiper-scroll-page-container{
    height: calc(100vh - 220px);
  }
}
</style>
